package com.bis.ymyy.controller;

import com.bis.ymyy.common.utils.Result;
import com.bis.ymyy.entity.VaccinesInfo;
import com.bis.ymyy.service.VaccinesInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/vaccinesInfo")
@Api(tags = "/疫苗信息相关接口")
public class VaccinesInfoController {
    @Autowired(required = false)
    private VaccinesInfoService vaccinesInfoService;

    @ApiOperation("/获取所有疫苗信息")
    @GetMapping("/findAllVaccinesInfo")
    public Result<List<VaccinesInfo>> findAllVaccinesInfo(){
        Result<List<VaccinesInfo>> result = new Result<>();
        List<VaccinesInfo> vaccinesInfoList = vaccinesInfoService.getAll();
        result.setSuccess(true);
        result.setCode(200);
        result.setMsg("成功");
        result.setData(vaccinesInfoList);
        return result;
    }
}
